<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>File: constraint_transform.rb</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



  <div id="fileHeader">
    <h1>constraint_transform.rb</h1>
    <table class="header-table">
    <tr class="top-aligned-row">
      <td><strong>Path:</strong></td>
      <td>constraint_transform.rb
      </td>
    </tr>
    <tr class="top-aligned-row">
      <td><strong>Last Update:</strong></td>
      <td>Tue Jun 19 14:45:55 India Standard Time 2007</td>
    </tr>
    </table>
  </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
This file is the for the constraint related transform. Currently supported
constraints include:
</p>
<ol>
<li>Primary key.

</li>
<li>Not null

</li>
<li>Unique

</li>
<li>auto_increment.(This also includes the verification if the column is of
numeric type)

</li>
</ol>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000024">add_the_constraint</a>&nbsp;&nbsp;
      <a href="#M000021">check_conflicting_constraints</a>&nbsp;&nbsp;
      <a href="#M000019">create_constraint_config</a>&nbsp;&nbsp;
      <a href="#M000023">drop_the_constraint</a>&nbsp;&nbsp;
      <a href="#M000022">search_constraint</a>&nbsp;&nbsp;
      <a href="#M000020">transform_constraint</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000024" class="method-detail">
        <a name="M000024"></a>

        <div class="method-heading">
          <a href="constraint_transform_rb.src/M000024.html" target="Code" class="method-signature"
            onclick="popupCode('constraint_transform_rb.src/M000024.html');return false;">
          <span class="method-name">add_the_constraint</span><span class="method-args">(table_name,column_name,constraint_name,new_connection)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
This is the actual implementation of the create_constraint transform.
</p>
        </div>
      </div>

      <div id="method-M000021" class="method-detail">
        <a name="M000021"></a>

        <div class="method-heading">
          <a href="constraint_transform_rb.src/M000021.html" target="Code" class="method-signature"
            onclick="popupCode('constraint_transform_rb.src/M000021.html');return false;">
          <span class="method-name">check_conflicting_constraints</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
This method checks if there are conflicting constraint specifications in
the config file.
</p>
        </div>
      </div>

      <div id="method-M000019" class="method-detail">
        <a name="M000019"></a>

        <div class="method-heading">
          <a href="constraint_transform_rb.src/M000019.html" target="Code" class="method-signature"
            onclick="popupCode('constraint_transform_rb.src/M000019.html');return false;">
          <span class="method-name">create_constraint_config</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
This file creates the template for the constraint transform configuration
file.
</p>
        </div>
      </div>

      <div id="method-M000023" class="method-detail">
        <a name="M000023"></a>

        <div class="method-heading">
          <a href="constraint_transform_rb.src/M000023.html" target="Code" class="method-signature"
            onclick="popupCode('constraint_transform_rb.src/M000023.html');return false;">
          <span class="method-name">drop_the_constraint</span><span class="method-args">(table_name,column_name,constraint_name,new_connection)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
This is the actual implementation of the drop_constraint transform.
</p>
        </div>
      </div>

      <div id="method-M000022" class="method-detail">
        <a name="M000022"></a>

        <div class="method-heading">
          <a href="constraint_transform_rb.src/M000022.html" target="Code" class="method-signature"
            onclick="popupCode('constraint_transform_rb.src/M000022.html');return false;">
          <span class="method-name">search_constraint</span><span class="method-args">(param_row,first_attr,row_num)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
This method scans through entire file if there is any conflicting
constraint given. In the context of the application, by conflicting
constraints, &#8216;creating and dropping the same constraint on same
column of same table&#8217;.
</p>
        </div>
      </div>

      <div id="method-M000020" class="method-detail">
        <a name="M000020"></a>

        <div class="method-heading">
          <a href="constraint_transform_rb.src/M000020.html" target="Code" class="method-signature"
            onclick="popupCode('constraint_transform_rb.src/M000020.html');return false;">
          <span class="method-name">transform_constraint</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
This method decides based on the first parameter of each row if the
constraint is to be added or removed. User needs to mention one of the
following as the first attr of each row.
</p>
<ol>
<li>drop_constraint: if the constraint has to be dropped.

</li>
<li>create_constraint: is the constraint has to be created.

</li>
</ol>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>